﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml.Linq;
using NextCMS.Models;

/// <summary>
/// Summary description for ContentPageController
/// </summary>
public class PagesHelper : IPage
{
    IPage pages = null;
    public PagesHelper()
	{
        pages = (IPage)NextCMS.DataAccess.Entities.CreateInstance<IPage>();
	}
    public PageModel GetByPageLanguageId(int id)
    {
        return pages.GetByPageLanguageId(id);
    }
    public IEnumerable<PageModel> GetByMasterPageId(int id)
    {
        return pages.GetByMasterPageId(id);
    }
    public IEnumerable<PageModel> GetAllBySiteId(int SiteId)
    {
        return pages.GetAllBySiteId(SiteId);
    }
    public PageModel GetPageByFileName(string fileName,int SiteId,int UserLanguageId)
    {
        return pages.GetPageByFileName(fileName,SiteId,UserLanguageId);
    }
    public PageModel GetPageByFileName(string fileName,int Id)
    {
        return pages.GetPageByFileName(fileName, Id);
    }
    public int Save(PageModel page)
    {
        return pages.Save(page);
    }
    // Delete Record
    public void Delete(int id)
    {
        pages.Delete(id);
    }

    // Edit Record
    public void Edit(PageModel page)
    {
        pages.Edit(page);
    }

    public void Dispose()
    {
        pages.Dispose();
        pages = null;
    }


    public IEnumerable<PageModel> GetAllBySiteIdLanguageId(int SiteId, int LanguageId)
    {
        return pages.GetAllBySiteIdLanguageId(SiteId, LanguageId);
    }


    public PageModel GetByPageId(int id)
    {
        return pages.GetByPageId(id);
    }


    public PageModel GetByPageIdLanguageId(int PageId, int LanguageId)
    {
        return pages.GetByPageIdLanguageId(PageId, LanguageId);
    }
}